import 'dart:convert';

import 'package:psi/entity/sales_entity.dart';
/// code : 0
/// message : "操作成功"
/// data : {"id":13,"userId":6,"stockUserName":"王伦机械厂","stockPhone":"15526374823","amount":1780448,"realAmount":50063,"payAmount":50000,"createTime":"2024-02-04 11:04:53","recordTime":"2024-02-04 10:54:07","isDelete":false,"itemList":[{"id":8,"stockId":13,"name":"成钢","material":"432","standards":"231","size":"3123","count":23,"price":1234,"mark":"无拘无束","isDelete":false},{"id":9,"stockId":13,"name":"切片钢","material":"铝合金","standards":"dfaf","size":"32*53*23","count":342,"price":5123,"mark":null,"isDelete":false}],"fullPay":false}

SalesItemResp salesItemRespFromJson(String str) => SalesItemResp.fromJson(json.decode(str));
String salesItemRespToJson(SalesItemResp data) => json.encode(data.toJson());
class SalesItemResp {
  SalesItemResp({
      this.code, 
      this.message, 
      this.data,});

  SalesItemResp.fromJson(dynamic json) {
    code = json['code'];
    message = json['message'];
    data = json['data'] != null ? SalesEntity.fromJson(json['data']) : null;
  }
  num? code;
  String? message;
  SalesEntity? data;
SalesItemResp copyWith({  num? code,
  String? message,
  SalesEntity? data,
}) => SalesItemResp(  code: code ?? this.code,
  message: message ?? this.message,
  data: data ?? this.data,
);
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['code'] = code;
    map['message'] = message;
    if (data != null) {
      map['data'] = data?.toJson();
    }
    return map;
  }

}
